package tommysmapeditor.input;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

import tommysmapeditor.editors.bo.TileMapFormat;

public class MapEditorInput implements IEditorInput{

	
	//for the tilemap format peculiarities of jako
	public String optionalTileNamePrefix ="";
	
	public List<Image> toDisposeOnSHutdown=new ArrayList<Image>();
	
	
	// used by export to c++
	public String[] tileFilePaths;
	public String EDITOR_WORK_TILES_PATH;
	
	
	
	/**
	 * the size of one tile in pixels
	 */
	public int _tileSize;
	
	
	
	public int _tileWidth;
	public int getTileWidth() {
		return _tileWidth;
	}


	public int getTileHeight() {
		return _tileHeight;
	}

	public int _tileHeight;
	
	/**
	 * different PIX
	 */
	public int _tileNumber;
	
	
	/**
	 * the map itself is here , it can be created or imported from file format
	 */
	public int[][] tileGrid;

	
	TileMapFormat _format;
	
	
	public Image[][] tiles ; // une ligne par niveau de zoom
	
	public MapEditorInput(int tileSize,int tileWidth,int tileLength){
		_tileWidth = tileWidth;
		_tileHeight = tileLength;
		_tileSize = tileSize;
		
		//tile grid init is here now 
		tileGrid =   new int[tileWidth][tileLength];
		//initialising tile grid
		for(int i=0; i<tileWidth;i++){
			for(int j=0;j<tileLength;j++){
				tileGrid[i][j]=0;
			}
		}
		

	}

	/**
	 * mandatory tiles init
	 */
	public void initTilesArray(int tileNumber){
		_tileNumber = tileNumber;
		tiles = new Image[3][tileNumber];
		//tiles need to be in the first squares
//		for(int i=0;i<_tileNumber;i++){
//			tileGrid[i][0]=i;
//		}
	}
	
	
	
	public boolean exists() {
		// TODO Auto-generated method stub
		return false;
	}

	public ImageDescriptor getImageDescriptor() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getName() {
		// TODO Auto-generated method stub
		return "";
	}

	public IPersistableElement getPersistable() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getToolTipText() {
		// TODO Auto-generated method stub
		return "";
	}

	public Object getAdapter(Class adapter) {
		// TODO Auto-generated method stub
		return null;
	}

}
